package com.ssm.anno.controller;

import com.alibaba.fastjson.JSON;
import com.ssm.anno.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 张富玮
 * @create 2022-01-28 19:58
 */
@RestController
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/")
    public String index() {
        return "首页";
    }

    @RequestMapping("/getAllUser")
    public String getAllUsers() {
        return JSON.toJSONString(userService);
    }
}
